package model

import (
	"gorm.io/gorm"
	"time"
)

type User struct {
	Id       uint           `gorm:"column:id;type:bigint(20) UNSIGNED;primaryKey;not null;" json:"id"`
	Username string         `gorm:"column:username;type:varchar(20);not null;" json:"username"`
	Password string         `gorm:"column:password;type:char(32);not null;" json:"password"`
	CreateAt time.Time      `gorm:"column:create_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"create_at"`
	Update   time.Time      `gorm:"column:update;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"update"`
	DeleteAt gorm.DeletedAt `gorm:"column:delete_at;type:datetime(3);default:NULL;" json:"delete_at"`
}

func (u *User) TableName() string {
	return "user"
}
